<script src="{{ getAssets }}js/amazeui.datatables.min.js?v={{ assets_version }}"></script>
<script>
	var tables = $('#dataTables').DataTable({
		"sAjaxSource" : location.href
		,"bLengthChange": false
		,"fnServerData" : function(sSource, aoData, fnCallback) {
			var params = checkQueryTableData(aoData)
			$('#search_key').val() ? params.Filter = $('#search_key').val() : ''
			$.post(sSource, JSON.stringify(params),function(resp) {
				fnCallback(resp);
			},'json')
		}
		,columns: [
			{"data" : "DocumentNumber","bSortable": false}
			,{"bSortable": false, render:function(data, type, full, meta) {
				return full.Archives.Mobile;
			}}
			,{"bSortable": false, render:function(data, type, full, meta) {
				return full.Archives.Realname;
			}}
			,{"mDataProp" : "Doctor", "bSortable": false}
			,{"mDataProp" : "Optometrist", "bSortable": false}
			,{"mDataProp": "CreatedAt", render:function(data, type, full, meta) {
				return timetrans(data);
			}}
			,{"mDataProp": "CreatedBy", "bSortable": false}
			,{
				"mDataProp": "Action",
				"bSortable": false,
				"sWidth":"8%",
				"render": function ( data, type, full, meta ) {
					btns = '<a href="javascript:;" class="am-btn am-btn-secondary am-btn-xs" onclick="showOptometryDetail(this, '+ meta.row +');return false;">展开</a>';
					return btns;
				}
			 }
		]
        ,"aLengthMenu":[20, 50, 100, 200]
		,'bLengthChange': true
		,"serverSide": true
		,"bPaginate" : true
		,"bFilter" : false	//是否启动过滤、搜索功能 
		,"bInfo" : true //是否显示页脚信息，DataTables插件左下角显示记录数
		,"bProcessing" : true //DataTables载入数据时，是否显示‘进度’提示  
		  
	});
    var showText = '关闭';
	function showOptometryDetail(o, r) {
        var data = tables.row(r).data();
        var record = {
            'duojiaodian':{'left':{}, 'right':{}},
            'far':{'left':{}, 'right':{}},
            'near':{'left':{}, 'right':{}},
            'yinxing':{'left':{}, 'right':{}},
        };
        if($('#opt-'+data.Id).length <= 0 ){
            if(data.chufang.duojiaodian) {
                record['duojiaodian']['left'] = data.chufang.duojiaodian.left;
                record['duojiaodian']['right'] = data.chufang.duojiaodian.right;
            }
            if(data.chufang.far) {
                record['far']['left']= data.chufang.far.left;
                record['far']['right'] = data.chufang.far.right;
            }

            if(data.chufang.near) {
                record.near.left = data.chufang.near.left;
                record.near.right = data.chufang.near.right;
            }

            if(data.chufang.yinxing) {
                record.yinxing.left = data.chufang.yinxing.left;
                record.yinxing.right = data.chufang.yinxing.right;
            }

            var html = insertChufangHtml(data.Id, record);
            $(o).parent().parent().after('<tr id="opt-'+ data.Id +'"><td colspan="9">'+ html +'</td></tr>');
        }
        $(o).text(showText);

        if(showText == '展开') {
            $('#opt-'+data.Id).hide();
        } else {
            $('#opt-'+data.Id).show();
        }
        showText = showText =='展开' ? '关闭' : '展开';
        return false;
    }

	function insertChufangHtml (id, record){
        var html=[];
        html.push('<div class="ms" style="display: ;">');
        if(record.near && record.near.right.total_pd_jin){
            chufang_type= "'near'";
            html.push('<div class="chufang">');
            html.push('<div class="title am-cf">');
            html.push('<h3>近用处方</h3>');
            html.push('</div>');
            html.push('<div class="datatable-shili" data-type="near" >');
            html.push('<div class="info-bar list-head am-cf">');
            html.push('<div class="item" style="width:11%">球镜</div>');
            html.push('<div class="item" style="width:11%">柱镜</div>');
            html.push('<div class="item" style="width:11%">轴位</div>');
            html.push('<div class="item" style="width:11%">瞳距(mm)</div>');
            html.push('<div class="item" style="width:11%">瞳高(mm)</div>');
            html.push('<div class="item" style="width:11%">裸眼视力</div>');
            html.push('<div class="item" style="width:11%">矫正视力</div>');
            html.push('<div class="item" style="width:11%">棱镜</div>');
            html.push('<div class="item" style="width:11%">基底</div>');
            html.push('</div>');
            html.push('<div class="info-bar blue-bg am-cf" data-type="right">');
            html.push(record.near.right.sph?'<div class="item" data-type="sph" style="width:11%">'+record.near.right.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
            html.push(record.near.right.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.near.right.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
            html.push(record.near.right.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.near.right.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
            html.push(record.near.right.pd_jin?'<div class="item" data-type="pd_jin" style="width:11%">'+record.near.right.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
            html.push(record.near.right.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.near.right.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
            html.push(record.near.right.nv?'<div class="item" data-type="nv" style="width:11%">'+record.near.right.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
            html.push(record.near.right.cv?'<div class="item" data-type="cv" style="width:11%">'+record.near.right.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
            html.push(record.near.right.v?'<div class="item" data-type="v" style="width:11%">'+record.near.right.v+'</div>':'<div class="item" data-type="v" style="width:11%"></div>');
            html.push(record.near.right.bc?'<div class="item" data-type="bc" style="width:11%">'+record.near.right.bc+'</div>':'<div class="item" data-type="bc" style="width:11%"></div>');
            html.push('<span class="type blue">右眼</span>');
            html.push('</div>');
            html.push('<div class="info-bar red-bg am-cf" data-type="left">');
            html.push(record.near.left.sph?'<div class="item" data-type="sph" style="width:11%">'+record.near.left.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
            html.push(record.near.left.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.near.left.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
            html.push(record.near.left.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.near.left.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
            html.push(record.near.left.pd_jin?'<div class="item" data-type="pd_jin" style="width:11%">'+record.near.left.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
            html.push(record.near.left.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.near.left.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
            html.push(record.near.left.nv?'<div class="item" data-type="nv" style="width:11%">'+record.near.left.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
            html.push(record.near.left.cv?'<div class="item" data-type="cv" style="width:11%">'+record.near.left.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
            html.push(record.near.left.v?'<div class="item" data-type="v" style="width:11%">'+record.near.left.v+'</div>':'<div class="item" data-type="v" style="width:11%"></div>');
            html.push(record.near.left.bc?'<div class="item" data-type="bc" style="width:11%">'+record.near.left.bc+'</div>':'<div class="item" data-type="bc" style="width:11%"></div>');
            html.push('<span class="type red">左眼</span>');
            html.push('</div>');
            html.push('<div class="info-bar define-row col4 am-cf">');
            html.push('<div class="item"><div class="pmr" data-type="total_pd_jin"><span>总近用瞳距:</span><b>'+record.near.right.total_pd_jin+'</b>mm</div></div>');
            html.push('</div>');
            html.push('<a class="clone-btn" href="javascript:void(0);" onclick="select_history('+id+','+chufang_type+')"><i class="am-icon-exchange"></i>引用</a>');
            html.push('</div>');
            html.push('</div>');
        }
        if(record.far && record.far.right.total_pd_yuan){
            chufang_type= "'far'";
            html.push('<div class="chufang">');
            html.push('<div class="title am-cf">');
            html.push('<h3>远用处方</h3>');
            html.push('</div>');
            html.push('<div class="datatable-shili" data-type="far" >');
            html.push('<div class="info-bar list-head am-cf">');
            html.push('<div class="item" style="width:11%">球镜</div>');
            html.push('<div class="item" style="width:11%">柱镜</div>');
            html.push('<div class="item" style="width:11%">轴位</div>');
            html.push('<div class="item" style="width:11%">瞳距(mm)</div>');
            html.push('<div class="item" style="width:11%">瞳高(mm)</div>');
            html.push('<div class="item" style="width:11%">裸眼视力</div>');
            html.push('<div class="item" style="width:11%">矫正视力</div>');
            html.push('<div class="item" style="width:11%">棱镜</div>');
            html.push('<div class="item" style="width:11%">基底</div>');
            html.push('</div>');
            html.push('<div class="info-bar blue-bg am-cf" data-type="right">');
            html.push(record.far.right.sph?'<div class="item" data-type="sph" style="width:11%">'+record.far.right.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
            html.push(record.far.right.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.far.right.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
            html.push(record.far.right.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.far.right.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
            html.push(record.far.right.pd_yuan?'<div class="item" data-type="pd_jin" style="width:11%">'+record.far.right.pd_yuan+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
            html.push(record.far.right.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.far.right.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
            html.push(record.far.right.nv?'<div class="item" data-type="nv" style="width:11%">'+record.far.right.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
            html.push(record.far.right.cv?'<div class="item" data-type="cv" style="width:11%">'+record.far.right.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
            html.push(record.far.right.v?'<div class="item" data-type="v" style="width:11%">'+record.far.right.v+'</div>':'<div class="item" data-type="v" style="width:11%"></div>');
            html.push(record.far.right.bc?'<div class="item" data-type="bc" style="width:11%">'+record.far.right.bc+'</div>':'<div class="item" data-type="bc" style="width:11%"></div>');
            html.push('<span class="type blue">右眼</span>');
            html.push('</div>');
            html.push('<div class="info-bar red-bg am-cf" data-type="left">');
            html.push(record.far.left.sph?'<div class="item" data-type="sph" style="width:11%">'+record.far.left.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
            html.push(record.far.left.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.far.left.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
            html.push(record.far.left.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.far.left.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
            html.push(record.far.left.pd_yuan?'<div class="item" data-type="pd_jin" style="width:11%">'+record.far.left.pd_yuan+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
            html.push(record.far.left.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.far.left.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
            html.push(record.far.left.nv?'<div class="item" data-type="nv" style="width:11%">'+record.far.left.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
            html.push(record.far.left.cv?'<div class="item" data-type="cv" style="width:11%">'+record.far.left.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
            html.push(record.far.left.v?'<div class="item" data-type="v" style="width:11%">'+record.far.left.v+'</div>':'<div class="item" data-type="v" style="width:11%"></div>');
            html.push(record.far.left.bc?'<div class="item" data-type="bc" style="width:11%">'+record.far.left.bc+'</div>':'<div class="item" data-type="bc" style="width:11%"></div>');
            html.push('<span class="type red">左眼</span>');
            html.push('</div>');
            html.push('<div class="info-bar define-row col4 am-cf">');
            html.push('<div class="item"><div class="pmr" data-type="total_pd_yuan"><span>总远用瞳距:</span><b>'+record.far.right.total_pd_yuan+'</b>mm</div></div>');
            html.push('</div>');
            html.push('<a class="clone-btn" href="javascript:void(0);" onclick="select_history('+id+','+chufang_type+')"><i class="am-icon-exchange"></i>引用</a>');
            html.push('</div>');
            html.push('</div>');
        }
        if(record.yinxing && (record.yinxing.right.sph||record.yinxing.left.sph)){
            chufang_type= "'yinxing'";
            html.push('<div class="chufang">');
            html.push('<div class="title am-cf">');
            html.push('<h3>隐形处方</h3>');
            html.push('</div>');
            html.push('<div class="datatable-shili" data-type="yinxing" >');
            html.push('<div class="info-bar list-head am-cf">');
            html.push('<div class="item" style="width:11%">球镜</div>');
            html.push('<div class="item" style="width:11%">柱镜</div>');
            html.push('<div class="item" style="width:11%">轴位</div>');
            html.push('<div class="item" style="width:11%">瞳距(mm)</div>');
            html.push('<div class="item" style="width:11%">瞳高(mm)</div>');
            html.push('<div class="item" style="width:11%">裸眼视力</div>');
            html.push('<div class="item" style="width:11%">矫正视力</div>');
            html.push('<div class="item" style="width:11%">直径</div>');
            html.push('<div class="item" style="width:11%">基弧</div>');
            html.push('</div>');
            html.push('<div class="info-bar blue-bg am-cf" data-type="right">');
            html.push(record.yinxing.right.sph?'<div class="item" data-type="sph" style="width:11%">'+record.yinxing.right.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
            html.push(record.yinxing.right.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.yinxing.right.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
            html.push(record.yinxing.right.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.yinxing.right.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
            html.push(record.yinxing.right.pd_jin?'<div class="item" data-type="pd_jin" style="width:11%">'+record.yinxing.right.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
            html.push(record.yinxing.right.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.yinxing.right.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
            html.push(record.yinxing.right.nv?'<div class="item" data-type="nv" style="width:11%">'+record.yinxing.right.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
            html.push(record.yinxing.right.cv?'<div class="item" data-type="cv" style="width:11%">'+record.yinxing.right.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
            html.push(record.yinxing.right.diameter?'<div class="item" data-type="diameter" style="width:11%">'+record.yinxing.right.diameter+'</div>':'<div class="item" data-type="diameter" style="width:11%"></div>');
            html.push(record.yinxing.right.base_curve?'<div class="item" data-type="base_curve" style="width:11%">'+record.yinxing.right.base_curve+'</div>':'<div class="item" data-type="base_curve" style="width:11%"></div>');
            html.push('<span class="type blue">右眼</span>');
            html.push('</div>');
            html.push('<div class="info-bar red-bg am-cf" data-type="left">');
            html.push(record.yinxing.left.sph?'<div class="item" data-type="sph" style="width:11%">'+record.yinxing.left.sph+'</div>':'<div class="item" data-type="sph" style="width:11%"></div>');
            html.push(record.yinxing.left.cyl?'<div class="item" data-type="cyl" style="width:11%">'+record.yinxing.left.cyl+'</div>':'<div class="item" data-type="cyl" style="width:11%"></div>');
            html.push(record.yinxing.left.axial_view?'<div class="item" data-type="axial_view" style="width:11%">'+record.yinxing.left.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:11%"></div>');
            html.push(record.yinxing.left.pd_jin?'<div class="item" data-type="pd_jin" style="width:11%">'+record.yinxing.left.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:11%"></div>');
            html.push(record.yinxing.left.mrp?'<div class="item" data-type="mrp" style="width:11%">'+record.yinxing.left.mrp+'</div>':'<div class="item" data-type="mrp" style="width:11%"></div>');
            html.push(record.yinxing.left.nv?'<div class="item" data-type="nv" style="width:11%">'+record.yinxing.left.nv+'</div>':'<div class="item" data-type="nv" style="width:11%"></div>');
            html.push(record.yinxing.left.cv?'<div class="item" data-type="cv" style="width:11%">'+record.yinxing.left.cv+'</div>':'<div class="item" data-type="cv" style="width:11%"></div>');
            html.push(record.yinxing.left.diameter?'<div class="item" data-type="diameter" style="width:11%">'+record.yinxing.left.diameter+'</div>':'<div class="item" data-type="diameter" style="width:11%"></div>');
            html.push(record.yinxing.left.base_curve?'<div class="item" data-type="bc" style="width:11%">'+record.yinxing.left.base_curve+'</div>':'<div class="item" data-type="base_curve" style="width:11%"></div>');
            html.push('<span class="type red">左眼</span>');
            html.push('</div>');
            html.push('<a class="clone-btn" href="javascript:void(0);" onclick="select_history('+id+','+chufang_type+')"><i class="am-icon-exchange"></i>引用</a>');
            html.push('</div>');
            html.push('</div>');
        }
        if(record.duojiaodian && (record.duojiaodian.right.total_pd_jin || record.duojiaodian.right.total_pd_yuan)){
            chufang_type= "'duojiaodian'";
            html.push('<div class="chufang">');
            html.push('<div class="title am-cf">');
            html.push('<h3>多焦点处方</h3>');
            html.push('</div>');
            html.push('<div class="datatable-shili" data-type="duojiaodian" >');
            html.push('<div class="info-bar list-head am-cf">');
            html.push('<div class="item" style="width:8.3%">球镜</div>');
            html.push('<div class="item" style="width:8.3%">柱镜</div>');
            html.push('<div class="item" style="width:8.3%">轴位</div>');
            html.push('<div class="item" style="width:8.3%">近瞳距(mm)</div>');
            html.push('<div class="item" style="width:8.3%">远瞳距(mm)</div>');
            html.push('<div class="item" style="width:8.3%">瞳高(mm)</div>');
            html.push('<div class="item" style="width:8.3%">裸眼视力</div>');
            html.push('<div class="item" style="width:8.3%">矫正视力</div>');
            html.push('<div class="item" style="width:8.3%">ADD</div>');
            html.push('<div class="item" style="width:8.3%">通道</div>');
            html.push('<div class="item" style="width:8.3%">棱镜</div>');
            html.push('<div class="item" style="width:8.3%">基底</div>');
            html.push('</div>');
            html.push('<div class="info-bar blue-bg am-cf" data-type="right">');
            html.push(record.duojiaodian.right.sph?'<div class="item" data-type="sph" style="width:8.3%">'+record.duojiaodian.right.sph+'</div>':'<div class="item" data-type="sph" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.cyl?'<div class="item" data-type="cyl" style="width:8.3%">'+record.duojiaodian.right.cyl+'</div>':'<div class="item" data-type="cyl" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.axial_view?'<div class="item" data-type="axial_view" style="width:8.3%">'+record.duojiaodian.right.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.pd_jin?'<div class="item" data-type="pd_jin" style="width:8.3%">'+record.duojiaodian.right.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.pd_yuan?'<div class="item" data-type="pd_yuan" style="width:8.3%">'+record.duojiaodian.right.pd_yuan+'</div>':'<div class="item" data-type="pd_yuan" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.mrp?'<div class="item" data-type="mrp" style="width:8.3%">'+record.duojiaodian.right.mrp+'</div>':'<div class="item" data-type="mrp" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.nv?'<div class="item" data-type="nv" style="width:8.3%">'+record.duojiaodian.right.nv+'</div>':'<div class="item" data-type="nv" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.cv?'<div class="item" data-type="cv" style="width:8.3%">'+record.duojiaodian.right.cv+'</div>':'<div class="item" data-type="cv" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.add_info?'<div class="item" data-type="add_info" style="width:8.3%">'+record.duojiaodian.right.add_info+'</div>':'<div class="item" data-type="add_info" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.pass?'<div class="item" data-type="pass" style="width:8.3%">'+record.duojiaodian.right.pass+'</div>':'<div class="item" data-type="pass" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.v?'<div class="item" data-type="v" style="width:8.3%">'+record.duojiaodian.right.v+'</div>':'<div class="item" data-type="v" style="width:8.3%"></div>');
            html.push(record.duojiaodian.right.bc?'<div class="item" data-type="bc" style="width:8.3%">'+record.duojiaodian.right.bc+'</div>':'<div class="item" data-type="bc" style="width:8.3%"></div>');
            html.push('<span class="type blue">右眼</span>');
            html.push('</div>');
            html.push('<div class="info-bar red-bg am-cf" data-type="left">');
            html.push(record.duojiaodian.left.sph?'<div class="item" data-type="sph" style="width:8.3%">'+record.duojiaodian.left.sph+'</div>':'<div class="item" data-type="sph" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.cyl?'<div class="item" data-type="cyl" style="width:8.3%">'+record.duojiaodian.left.cyl+'</div>':'<div class="item" data-type="cyl" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.axial_view?'<div class="item" data-type="axial_view" style="width:8.3%">'+record.duojiaodian.left.axial_view+'</div>':'<div class="item" data-type="axial_view" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.pd_jin?'<div class="item" data-type="pd_jin" style="width:8.3%">'+record.duojiaodian.left.pd_jin+'</div>':'<div class="item" data-type="pd_jin" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.pd_yuan?'<div class="item" data-type="pd_yuan" style="width:8.3%">'+record.duojiaodian.left.pd_yuan+'</div>':'<div class="item" data-type="pd_yuan" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.mrp?'<div class="item" data-type="mrp" style="width:8.3%">'+record.duojiaodian.left.mrp+'</div>':'<div class="item" data-type="mrp" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.nv?'<div class="item" data-type="nv" style="width:8.3%">'+record.duojiaodian.left.nv+'</div>':'<div class="item" data-type="nv" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.cv?'<div class="item" data-type="cv" style="width:8.3%">'+record.duojiaodian.left.cv+'</div>':'<div class="item" data-type="cv" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.add_info?'<div class="item" data-type="add_info" style="width:8.3%">'+record.duojiaodian.left.add_info+'</div>':'<div class="item" data-type="add_info" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.pass?'<div class="item" data-type="pass" style="width:8.3%">'+record.duojiaodian.left.pass+'</div>':'<div class="item" data-type="pass" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.v?'<div class="item" data-type="v" style="width:8.3%">'+record.duojiaodian.left.v+'</div>':'<div class="item" data-type="v" style="width:8.3%"></div>');
            html.push(record.duojiaodian.left.bc?'<div class="item" data-type="bc" style="width:8.3%">'+record.duojiaodian.left.bc+'</div>':'<div class="item" data-type="bc" style="width:8.3%"></div>');
            html.push('<span class="type red">左眼</span>');
            html.push('</div>');
            html.push('<div class="info-bar define-row col4 am-cf">');
            html.push('<div class="item"><div class="pmr" data-type="total_pd_jin"><span>总近用瞳距:</span><b>'+record.duojiaodian.right.total_pd_jin+'</b>mm</div></div>');
            html.push('<div class="item"><div class="pmr" data-type="total_pd_yuan"><span>总远用瞳距:</span><b>'+record.duojiaodian.right.total_pd_yuan+'</b>mm</div></div>');
            html.push('</div>');
            html.push('<a class="clone-btn" href="javascript:void(0);" onclick="select_history('+id+','+chufang_type+')"><i class="am-icon-exchange"></i>引用</a>');
            html.push('</div>');
            html.push('</div>');
        }
        html.push('</div>');
        html.push('</div>');
        return html.join("");
    }
    function select_history(id, chufang_type) {
        parent.getMoreOptometryData(id, chufang_type);
        parent.layer.closeAll();
    }
    
</script>